package com.example.validdemo.model;

import com.example.validdemo.validator.Validator;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 系统用户
 *
 * @author Bx_Hu
 */
@Data
@Accessors(chain = true)
public class UserRoleVO implements Serializable {

    @ApiModelProperty(value = "用户id")
    @NotNull(message = "用户不存在", groups = {Validator.Add.class})
    private Long userId;

    /**
     * 用户角色
     */
    @ApiModelProperty(value = "用户角色")
    @NotNull(message = "用户角色必填", groups = {Validator.Add.class, Validator.Update.class})
    @Valid
    private Role role;


    private static final long serialVersionUID = 1L;
}
